package com.yy.module.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.GenericGenerator;
import com.yy.base.common.entity.BaseEntity;

/**
 * 模块字段表
 */
@Entity
@Table(name="t_module_field")
public class ModuleField extends BaseEntity {
	public static final String TREE_FIELD_ID = "id";
	public static final String TREE_FIELD_TEXT = "text";
	public static final String TREE_FIELD_PARENTID = "parentId";
	
	public static final String DATA_VALUE_DATE = "date";
	public static final String DATA_VALUE_NUMBER = "number";
	public static final String DATA_VALUE_TEXT = "text";
	public static final String DATA_VALUE_SELECT = "select";
	public static final String DATA_VALUE_TREE = "tree";
	
	private String moduleId;//模块ID
	private String tableId;//表ID
	private String columnId;//列ID
	private String tableName;//表说明名
	private String fieldName;//字段名，如：name
	private String name;//显示名称
	private Integer isHide = 0;//是否隐藏
	private Integer isId = 0;//是否是主键，1：是，0：否
	private Integer isNotNull = 0;//是否不能为空，1：是，0：否
	private Integer isNotUpdate = 0;//不能能修改，1：是，0：否
	private Integer isOperation = 0;//是否是操作列，1：是，0：否
	private Integer isOnly = 0;//字段是否做唯一判断
	
	private String orderByDesc;//排序方式(不为空就为排序字段)
	
	private String treeType;//树形结构对象，id,text,parentId
	private String type;//输入框类型，text,select,textarea,date,tree,open
	private String defaultValue;//默认值
	private String options;//选项list json 格式
	private String format;//数据格式
	private Integer width = 150;//
	private Integer height;//
	private Integer orderBy = 10;//排序
	private String remark;//
	private String newLine;//另起一行
	private String isCenter;//居中
	private String colSpan;//合并列数
	private String css;//样式
	private String titleCss;//标题样式
	private String hideTitle;//隐藏标题
	private String id;
	@Id
	@Column(name="ID", length = 32, nullable = false)
    @GeneratedValue(generator = "uuid2" )//指定生成器名称
    @GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator" )
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getModuleId() {
		return moduleId;
	}
	public void setModuleId(String moduleId) {
		this.moduleId = moduleId;
	}
	public String getTableId() {
		return tableId;
	}
	public void setTableId(String tableId) {
		this.tableId = tableId;
	}
	public String getColumnId() {
		return columnId;
	}
	public void setColumnId(String columnId) {
		this.columnId = columnId;
	}
	@Transient
	public String getTableName() {
		return tableName;
	}
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
	public String getFieldName() {
		return fieldName;
	}
	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getIsHide() {
		return isHide;
	}
	public void setIsHide(Integer isHide) {
		this.isHide = isHide;
	}
	public Integer getIsNotNull() {
		return isNotNull;
	}
	public void setIsNotNull(Integer isNotNull) {
		this.isNotNull = isNotNull;
	}
	public Integer getIsNotUpdate() {
		return isNotUpdate;
	}
	public void setIsNotUpdate(Integer isNotUpdate) {
		this.isNotUpdate = isNotUpdate;
	}
	public Integer getIsId() {
		return isId;
	}
	public void setIsId(Integer isId) {
		this.isId = isId;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getDefaultValue() {
		return defaultValue;
	}
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}
	public Integer getWidth() {
		return width;
	}
	public void setWidth(Integer width) {
		this.width = width;
	}
	public Integer getHeight() {
		return height;
	}
	public void setHeight(Integer height) {
		this.height = height;
	}
	public String getOptions() {
		return options;
	}
	public void setOptions(String options) {
		this.options = options;
	}
	public Integer getIsOperation() {
		return isOperation;
	}
	public void setIsOperation(Integer isOperation) {
		this.isOperation = isOperation;
	}
	@Transient
	public Integer getIsOnly() {
		return isOnly;
	}
	public void setIsOnly(Integer isOnly) {
		this.isOnly = isOnly;
	}
	public String getOrderByDesc() {
		return orderByDesc;
	}
	public void setOrderByDesc(String orderByDesc) {
		this.orderByDesc = orderByDesc;
	}
	public String getTreeType() {
		return treeType;
	}
	public void setTreeType(String treeType) {
		this.treeType = treeType;
	}
	public String getFormat() {
		return format;
	}
	public void setFormat(String format) {
		this.format = format;
	}
	public Integer getOrderBy() {
		return orderBy;
	}
	public void setOrderBy(Integer orderBy) {
		this.orderBy = orderBy;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	@Column(name="NEW_LINE")
	public String getNewLine() {
		return newLine;
	}
	public void setNewLine(String newLine) {
		this.newLine = newLine;
	}
	@Column(name="IS_CENTER")
	public String getIsCenter() {
		return isCenter;
	}
	public void setIsCenter(String isCenter) {
		this.isCenter = isCenter;
	}
	public String getColSpan() {
		return colSpan;
	}
	public void setColSpan(String colSpan) {
		this.colSpan = colSpan;
	}
	public String getCss() {
		return css;
	}
	public void setCss(String css) {
		this.css = css;
	}
	@Column(name="TITLE_CSS")
	public String getTitleCss() {
		return titleCss;
	}
	public void setTitleCss(String titleCss) {
		this.titleCss = titleCss;
	}
	@Column(name="HIDE_TITLE")
	public String getHideTitle() {
		return hideTitle;
	}
	public void setHideTitle(String hideTitle) {
		this.hideTitle = hideTitle;
	}
}